package com.example.administrator.szb.util;

import android.app.Activity;

import java.util.ArrayList;
import java.util.List;

/**
 * Created by stone on 2016/10/8.
 */

public class FinishActivity {

    private static List<Activity> list = new ArrayList<>();

    public static void add(Activity activity){
        if (!list.contains(activity)){
            list.add(activity);
        }
    }
    public static void finish(){
        for (int i=0;i<list.size();i++){
            list.get(i).finish();
        }
        clear();
    }

    private static void clear(){
        list.clear();
    }

}
